This statistical program calculates n (# of observations) needed in a 
data set for 1 or 2 samples.  (used for both means and proportions) 
----begin documentation----
Program:  Nfind
Author:  Dan Watkins (Goodman@Brahms.udel.edu)
Size:  539 bytes

This program calculates n (the # of observations) needed in a data 
sample; given:

1 or 2 samples
Means or Proportions
Width or Boundary
z alpha/2 (from a table)

If means:  input mean and variance
If proportions:  Input pHAT 
----end documentation----
----begin ascii----
\START\
\COMMENT=Program file dated 03/11/93, 22:28
\NAME=Nfind
\FILE=nfind.85P
ClLCD
Disp "1 or 2 samples"
Input A
Disp "1=Mean or 0=Prop"
Input E
Disp "1=W or 0=B"
Input X
If X
Goto A
Prompt B
Lbl B
Disp "z \LC-alpha\/2"
Input C
If A==1
Then
If E
Then
Disp "\LC-sigma\\^2\ variance"
Input Z
(C\^2\*Z)/B\^2\\->\D
Goto C
Else
Prompt pHAT
(C\^2\(pHAT(1-pHAT))/B\^2\\->\D
Goto C
End
Else
If E
Then
Disp "\LC-sigma\\^2\1 variance"
Input Z
Disp "\LC-sigma\\^2\2 variance"
Input Y
(C\^2\(Z+Y))/B\^2\\->\D
Goto C
Else
Prompt pHAT1
Prompt pHAT2
(C\^2\((pHAT1(1-pHAT1))+(pHAT2(1-pHAT2)))/B\^2\\->\D
Goto C
End
Lbl A
Prompt W
W/2\->\B
Goto B
Lbl C
If D>round(D,0)
Then
(D+1)\->\D
round(D,0)\->\D
Else
round(D,0)\->\D
End
If A==1
Disp "N"
If A==2
Disp "N (Per sample)"
Disp D
If A==2
Then
Disp "N (Total)"
(2*D)\->\D
Disp D
End
Stop
\STOP\
----end ascii----
----begin uue----
begin 644 nfind.85p
M*BI423@U*BH:#`!0<F]G<F%M(&9I;&4@9&%T960@,#,O,3$O.3,L(#(R.C(X
M``!"-^)MI)*6`@D`B0(2!4YF:6YDB0*'`@!#;$Q#1-9$:7-P("(Q(&]R(#(@
M<V%M<&QE<R+626YP=70@0=9$:7-P("(Q/4UE86X@;W(@,#U0<F]P(M9);G!U
M="!%UD1I<W`@(C$]5R!O<B`P/4(BUDEN<'5T(%C6268@6-9';W1O($'64')O
M;7!T($+63&)L($+61&ES<"`B>B"[+S(BUDEN<'5T($/6268@03T],=94:&5N
MUDEF($765&AE;M9$:7-P("+'$B!V87)I86YC92+626YP=70@6M8H0Q(J6BDO
M0A(<1-9';W1O($/616QS9=90<F]M<'0@<$A!5-8H0Q(H<$A!5"@Q+7!(050I
M*2]"$AQ$UD=O=&\@0]9%;F3616QS9=9)9B!%UE1H96[61&ES<"`BQQ(Q('9A
M<FEA;F-E(M9);G!U="!:UD1I<W`@(L<2,B!V87)I86YC92+626YP=70@6=8H
M0Q(H6BM9*2DO0A(<1-9';W1O($/616QS9=90<F]M<'0@<$A!5#'64')O;7!T
M('!(050RUBA#$B@H<$A!5#$H,2UP2$%4,2DI*RAP2$%4,B@Q+7!(050R*2DI
M+T(2'$361V]T;R!#UD5N9-9,8FP@0=90<F]M<'0@5]97+S(<0M9';W1O($+6
M3&)L($/6268@1#YR;W5N9"A$+#`IUE1H96[6*$0K,2D<1-9R;W5N9"A$+#`I
M'$3616QS9=9R;W5N9"A$+#`I'$3616YDUDEF($$]/3'61&ES<"`B3B+6268@
M03T],M9$:7-P(").("A097(@<V%M<&QE*2+61&ES<"!$UDEF($$]/3+65&AE
M;M9$:7-P(").("A4;W1A;"DBUB@R*D0I'$361&ES<"!$UD5N9-93=&]PG^D`
`
end
----end uue----
